package com.standstill.controller;

import com.sun.xml.internal.ws.api.model.MEP;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("amqp/queue")
public class AMQPController {

    @Autowired
    private AmqpTemplate amqpTemplate;

    private final String DEFAULT_QUEUE_NAME = "q_stdl_queue";

    @RequestMapping("send")
    public void send(@RequestParam String message){
        this.amqpTemplate.convertAndSend(DEFAULT_QUEUE_NAME , message);
    }
}
